<template>
  <div class="system">
    <div class="herdertop">
      <img src="../../assets/top.png" alt="" class="topImg" />
      <el-breadcrumb separator="/">
        <el-breadcrumb-item>系统管理</el-breadcrumb-item>
        <el-breadcrumb-item>系统配置</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <el-container>
      <el-main>
        <!-- 房屋基础配置 -->
        <houseconfig :systemConfigHouseVos="systemConfigHouseVos" @research="initData"></houseconfig>
        <!-- 订单基础配置 -->
        <orderconfig :systemConfigOrderVo="systemConfigOrderVo" @research="initData"></orderconfig>
        <!-- 派单基础配置 -->
        <dispatchorderconfig :systemConfigSendOrderVo="systemConfigSendOrderVo" @research="initData"></dispatchorderconfig>
        <!-- 通知基础配置 -->
        <noticeconfig :systemConfigNoticeVo="systemConfigNoticeVo" @research="initData"></noticeconfig>
        <!-- 星管家配置 -->
        <starhousekeepconfig :systemConfigStarManagement="systemConfigStarManagement" @research="initData"></starhousekeepconfig>
        <!-- 轮播默认图配置 -->
        <swiperconfig :systemConfigDefaultPic="systemConfigDefaultPic" @research="initData"></swiperconfig>
        <!-- 售后基础配置 -->
        <aftersaleconfig :systemConfigAfterSale="systemConfigAfterSale" @research="initData"></aftersaleconfig>
        <!-- 节假日配置 -->
        <holidayConfig :systemConfigHolidays="systemConfigHolidays" @research="initData"></holidayConfig>
        <!-- 偏好配置 -->
        <serve-like-config :systemConfigHobbies="systemConfigHobbies" @research="initData"></serve-like-config>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import Aftersaleconfig from './aftersaleconfig.vue'
import Dispatchorderconfig from './dispatchorderconfig.vue'
import Houseconfig from './houseconfig.vue'
import Noticeconfig from './noticeconfig.vue'
import Orderconfig from './orderconfig.vue'
import Starhousekeepconfig from './starhousekeepconfig.vue'
import Swiperconfig from './swiperconfig.vue'
import holidayConfig from './holidayConfig.vue'
import serveLikeConfig from './serveLikeConfig.vue'
export default {
  data () {
    return {
      systemConfigHouseVos: [],
      systemConfigOrderVo: {},
      systemConfigSendOrderVo: {},
      systemConfigNoticeVo: {},
      systemConfigStarManagement: {},
      systemConfigDefaultPic: {},
      systemConfigAfterSale: {},
      systemConfigHolidays: {},
      systemConfigHobbies: {}
    }
  },
  components: {
    Orderconfig,
    Dispatchorderconfig,
    Noticeconfig,
    Starhousekeepconfig,
    Houseconfig,
    Swiperconfig,
    Aftersaleconfig,
    holidayConfig,
    serveLikeConfig
  },
  methods: {
    async initData () {
      const { data } = await this.$http({
        url: '/hsssystemadmin/config/system/fetchSystemConfig',
        method: 'post'
      })
      const {
        systemConfigHouseVos, // 房屋基础配置
        systemConfigOrderVo, // 订单基础配置
        systemConfigSendOrderVo, // 派单基础配置
        systemConfigNoticeVo, // 通知基础配置
        systemConfigStarManagement, // 星管家基础配置
        systemConfigDefaultPic, // 默认图基础配置
        systemConfigAfterSale, // 售后基础配置
        systemConfigHolidays, // 节假日配置
        systemConfigHobbies, // 用户偏好配置
      } = data
      this.systemConfigHouseVos = systemConfigHouseVos
      this.systemConfigOrderVo = systemConfigOrderVo
      this.systemConfigSendOrderVo = systemConfigSendOrderVo
      this.systemConfigNoticeVo = systemConfigNoticeVo
      this.systemConfigStarManagement = systemConfigStarManagement
      this.systemConfigDefaultPic = systemConfigDefaultPic
      this.systemConfigAfterSale = systemConfigAfterSale
      this.systemConfigHolidays = systemConfigHolidays
      this.systemConfigHobbies = systemConfigHobbies
    }
  },
  mounted () {
    this.initData()
  }
}
</script>

<style lang="scss"
Orderconfig scoped>
.system {
  .el-container {
    padding: 10px;
    background-color: #fff;
    .el-main {
      // height: 100%;
      background-color: #ebeef1;
      padding: 10px;
    }
  }
}
.herdertop {
  height: 8vh;
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
}
.topImg {
  margin-right: 20px;
}
</style>
